#ifndef __ERRMESSAGE_H__
#define __ERRMESSAGE_H__
#include <server_conf.h>
#include <stdint.h>

//错误类型枚举
enum err_type
{
	NO_ERR = 0,
	CRC_ERR,
	DATA_ERR,
	QUER_ERR,
	RECEV_ERR,
	TYPE_ERR,
	ANALYSIS_ERR,
	CLIET_ERR,
	CLIENTID_ERR,
	DETECT_ERR,
	DETECTID_ERR,
	LISTNODE_ERR,
	SQLSTORE_ERR,
	DATALENTH_ERR,
	DATATTOMORE_ERR,
	PARAMAS_ERR,
	TIMEOUT_ERR,
	UPDATERIME_ERR,
	ERRTYPEMAX
};

//错误信息数据结构
struct errdata_st
{
	unsigned short type;
	unsigned short datalenth;
	char err_data[ERRMSGSIZE];
	uint8_t crc16_l;
	uint8_t crc16_h;
};

void err_message(int fd,unsigned short type);

#endif

